<%@ page language="java" %>

<%@ page import="com.scalar.chiptrack.commons.SessionKeys,
                 com.scalar.chiptrack.utils.ConfigManager,
				 com.scalar.chiptrack.commons.Constants,
				 com.scalar.chiptrack.users.Functionality,
				 com.scalar.chiptrack.users.User"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<chiptrack:checkLogon sourcePage="/lotTransfer.do" />
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();try{%>

<HTML>
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet"></HEAD>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>

<SCRIPT language="JavaScript">

function confirmShipRequest()
{
    document.shippingRequestViewForm.action = '<%=chipTracContext%>/shippingRequest.do?action=confirm';
    document.shippingRequestViewForm.submit();
    //return true;
}

function editShipRequest()
{
    document.shippingRequestViewForm.action = '<%=chipTracContext%>/shippingRequest.do?action=<%=Constants.ACTION_EDIT%>';
    document.shippingRequestViewForm.submit();
}

function printView( shipReqId )
{
    newWindow = window.open ('<%=chipTracContext%>/shippingRequest.do?action=printerFriendly&shipReqId='+shipReqId,'printerFreindlyPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=800,height=550,resizable=yes');
}
</SCRIPT>
<BODY bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
	<TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

	<!-- Side Navigation start -->
	<%@ include file="/jsp/operations/dataentryMenu.jsp" %></TD>
	<!-- end of the side navigations -->

	<TD bgcolor="#ffffff">
	<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
	<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
	<TD valign="top" width="100%">

	<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
	<BR>

	<html:form action="/shippingRequest.do" name="shippingRequestViewForm" method="POST" type="com.scalar.chiptrack.operations.shippingRequest.forms.ShippingRequestForm">
        <nested:nest property="shippingRequest">
       	<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='0' WIDTH='90%' bordercolor='#000000' ALIGN='CENTER'>
            <logic:equal  name="isConfirm" value="true">
                <logic:equal name="showMessage" value="TRUE">
                    <tr><td colspan="4" align='left'><font class='NArialS'color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b></font></td></tr>
                </logic:equal>
                <tr>
                    <td colspan='4'>
                    <font class='NArialL'><font color='red'>Are you sure, you want to Confirm this Ship Request &nbsp;&nbsp;</font></font>
                    <chiptrack:restrictedLink functionality='<%=Functionality.APPROVE_SORT_RELEASE %>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:confirmShipRequest();' onmouseover="window.status='Confirm this Ship Request';return true" onmouseout="window.status='';return true"><img src='<%=chipTracContext%>/jsp/includes/images/confirm.gif' border='0'></chiptrack:restrictedLink>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <a href="javascript:editShipRequest()" onMouseOver="window.status='Click To Edit Shipping Request';return true" onMouseOut="window.status='';return true">
                    <img src='<%=chipTracContext%>/jsp/includes/images/edit.gif' border='0'></a>
                    </td>
                </tr>
            </logic:equal>
        </table>
        <TABLE width="80%" align="center" cellpadding="2" cellspacing="2" border="0">
			<TR><TD colspan="4" class="NArialW" align="center">Ship Request</TD></TR>
            <logic:notEqual  name="isConfirm" value="true">
                <TR>
                    <TD colspan='4' align="center"  class="NArialS">
                        <A href="javascript:printView('<nested:write property="shipRequestId"/>');"onMouseOver="window.status='Click for Printer Friendly Version';return true" onMouseOut="window.status='';return true"><B>[Printer-Friendly]</B></A>
                    </TD>
                    <%--<TD colspan='4' align="left"  class="NArialS">
                        <A href="javascript:sendMail('<nested:write property="sortRelId"/>');"onMouseOver="window.status='Click to Email This Sort Release';return true" onMouseOut="window.status='';return true"><B>[E-mail this Sort Release]</B></A>
                    </TD>--%>
                </TR>

            </logic:notEqual>
			<TR><TD colspan='4' align="left" class='NArialL'>&nbsp;<FONT id="errors" color='FF0000'></font></TD></TR>
			<TR><TD colspan='4' class="NArialL"><chiptrack:errors styleClass="NArialL"/></TD></TR>
			<TR><TD colspan='4' class="NArialL"><chiptrack:info styleClass="NArialL"/></TD></TR>
			<TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
            <tr>
			<td class="NArialL" width="20%">
				Ship Request #:<font color=red>*</font>
			</td>
			<td class="NArialL" width="15%">
                <nested:text  property="shipReqNumber" styleClass="txfield" disabled="true"/>
			</td>
			<td class="NArialL" width="20%">
				Ship Req Date:<font color=red>*</font>
			</td>
			<td class="NArialL" width="25%">
			    <nested:text  property="shipReqDate" size="20" styleClass="txfield" disabled="true"/>
			</td>
            </tr>
             <tr>
                <td class="NArialL" width="20%">From Location:
				</td>
                <td width="15%" class="NArialL" nowrap>
                    <nested:text  property="fromVendorName" size="20" maxlength="50"  styleClass="txfield" disabled="true"/>
                </td>
                <td class="NArialL"colspan="2" width="20%">&nbsp;</td>
            </tr>
            <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
            <tr>
				<td class="NArialL">
					Address1:
				</td>
				<td class="NArialL">
					<nested:text  property="fromVendorAddress.address1" size="20" styleClass="txfield" disabled="true"/>
				</td>
				<td class="NArialL">
					Address2:
				</td>
				<td class="NArialL">
					<nested:text  property="fromVendorAddress.address2" size="20" styleClass="txfield" disabled="true"/>
				</td>
			</tr>
			<tr>
				<td class="NArialL">
					Address3:
				</td>
				<td class="NArialL">
					<nested:text  property="fromVendorAddress.address3" size="20" styleClass="txfield" disabled="true"/>
				</td>
				<td class="NArialL">
					Address4:
				</td>
				<td class="NArialL">
					<nested:text  property="fromVendorAddress.address4" size="20" styleClass="txfield" disabled="true"/>
				</td>
			</tr>
			<tr>
				<td class="NArialL">
					City:
				</td>
				<td class="NArialL">
					<nested:text  property="fromVendorAddress.city" size="20" styleClass="txfield" disabled="true"/>
				</td>
				<td class="NArialL">
					State:
				</td>
				<td class="NArialL">
					<nested:text  property="fromVendorAddress.state" size="20" styleClass="txfield" disabled="true"/>
				</td>
			</tr>
			<tr>
				<td class="NArialL">
					Country:
				</td>
				<td class="NArialL">
					<nested:text  property="fromVendorAddress.country" size="20" styleClass="txfield" disabled="true"/>
				</td>
				<td class="NArialL">
					Zip:
				</td>
				<td class="NArialL">
					<nested:text  property="fromVendorAddress.zipCode" size="20" styleClass="txfield" disabled="true"/>
				</td>
			</tr>
            <tr>
                <td class="NArialL">
					Phone:
				</td>
                <td class="NArialL">
					<nested:text  property="fromVendorAddress.phoneNumber" size="20" styleClass="txfield" disabled="true"/>
				</td>
				<td class="NArialL">
					Fax:
				</td>
				<td class="NArialL">
					<nested:text  property="fromVendorAddress.faxNumber" size="20" styleClass="txfield" disabled="true"/>
				</td>
            </tr>
            <tr>
                <td class="NArialL">
					Contact Person:
				</td>
                    <td class="NArialL">
					<nested:text property="fromVendorAddress.contactPerson" size="20" styleClass="txfield" disabled="true"/>
				</td>

				<td class="NArialL">
					Email:
				</td>
				<td class="NArialL">
					<nested:text property="fromVendorAddress.email" size="20" styleClass="txfield" disabled="true"/>
				</td>
            </tr>
             <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
             <tr>
                <td class="NArialL" width="20%">Ship To Location:
				</td>
                <td width="15%" class="NArialL" nowrap>
                    <nested:text  property="toVendorName" size="20" maxlength="50"  styleClass="txfield" disabled="true"/>
                </td>
                <td class="NArialL"colspan="2" width="20%">&nbsp;</td>
             </tr>
             <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
            <tr>
				<td class="NArialL">
					Address1:
				</td>
				<td class="NArialL">
					<nested:text property="toVendorAddress.address1" size="20" styleClass="txfield" disabled="true"/>
				</td>
				<td class="NArialL">
					Address2:
				</td>
				<td class="NArialL">
					<nested:text  property="toVendorAddress.address2" size="20" styleClass="txfield" disabled="true"/>
				</td>
			</tr>
			<tr>
				<td class="NArialL">
					Address3:
				</td>
				<td class="NArialL">
					<nested:text  property="toVendorAddress.address3" size="20" styleClass="txfield" disabled="true"/>
				</td>
				<td class="NArialL">
					Address4:
				</td>
				<td class="NArialL">
					<nested:text  property="toVendorAddress.address4" size="20" styleClass="txfield" disabled="true"/>
				</td>
			</tr>
			<tr>
				<td class="NArialL">
					City:
				</td>
				<td class="NArialL">
					<nested:text  property="toVendorAddress.city" size="20" styleClass="txfield" disabled="true"/>
				</td>
				<td class="NArialL">
					State:
				</td>
				<td class="NArialL">
					<nested:text  property="toVendorAddress.state" size="20" styleClass="txfield" disabled="true"/>
				</td>
			</tr>
			<tr>
				<td class="NArialL">
					Country:
				</td>
				<td class="NArialL">
					<nested:text property="toVendorAddress.country" size="20" styleClass="txfield" disabled="true"/>
				</td>
				<td class="NArialL">
					Zip:
				</td>
				<td class="NArialL">
					<nested:text property="toVendorAddress.zipCode" size="20" styleClass="txfield" disabled="true"/>
				</td>
			</tr>
            <tr>
                <td class="NArialL">
					Phone:
				</td>
                <td class="NArialL">
					<nested:text property="toVendorAddress.phoneNumber" size="20" styleClass="txfield" disabled="true"/>
				</td>
				<td class="NArialL">
					Fax:
				</td>
				<td class="NArialL">
					<nested:text property="toVendorAddress.faxNumber" size="20" styleClass="txfield" disabled="true"/>
				</td>
            </tr>
            <tr>
                <td class="NArialL">
					Contact Person:
				</td>
                    <td class="NArialL">
					<nested:text property="toVendorAddress.contactPerson" size="20" styleClass="txfield" disabled="true"/>
				</td>

				<td class="NArialL">
					Email:
				</td>
				<td class="NArialL">
					<nested:text property="toVendorAddress.email" size="20" styleClass="txfield" disabled="true"/>
				</td>
            </tr>
            <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
            <tr>
                <td class="NArialL" width="15%">Shipper:
                </td>
                <td width="15%" class="NArialL" nowrap>
                    <nested:select  property="shipperId"  styleClass="txfield" disabled="true">
                        <html:option value="-1">--Select--</html:option>
                        <nested:optionsCollection property="shippersList" value="value" label="label"/>
                    </nested:select>
                </td>
                <td class="NArialL"colspan="2" width="20%">&nbsp;</td>
            </tr>
            <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
            <tr>
                <td class="NArialL"  width="35%">Please send Ship Alerts:
                </td>
                <td class="NArialL"colspan="3" width="20%"><nested:textarea property="shipAlerts" cols="38" rows="7" styleClass="txfield" disabled="true"/></td>
            </tr>
            <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
            <tr>
                <td class="NArialL" colspan="2"  width="45%"><b>Please Ship the following Product</b>
                </td>
                <td class="NArialL" colspan="2" width="20%">&nbsp;</td>
            </tr>
            <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
             <tr>
                <td class="NArialL" width="15%"> Product :
                </td>
                <td width="15%" class="NArialL" nowrap>
                    <nested:text property="partNumber" size="20" maxlength="50"  styleClass="txfield" disabled="true"/>
                </td>
                <td class="NArialL"colspan="2" width="20%">&nbsp;</td>
            </tr>

            <TR>
                <TD colspan='4'>
                    <table width="50%" align="left" cellpadding="2" cellspacing="2" border="0">
                        <tr>
                             <td width="3%" class="NArialL" bgcolor="#993333" nowrap align="center" >
                                <font color="#FFFFFF" >Select</font>
                             </td>
                            <td width="10%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                <font color="#FFFFFF">Lot Number</font>
                            </td>
                            <td width="10%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                <font color="#FFFFFF">Qty Available</font>
                            </td>
                            <td width="10%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                <font color="#FFFFFF">Transfer Qty</font>
                            </td>

                        </tr>
                        <% int totalPulledQty = 0; %>
                        <nested:iterate property="lotList" type="com.scalar.chiptrack.operations.shippingRequest.ShippingRequestLot" id="shippingRequestLot" indexId="iteratorIdx" >
                          <tr  <%  if ( iteratorIdx.intValue()%2==0 ) { %>
                              bgcolor='#DEE1E2'
                            <% } else {%>
                            bgcolor='#FFFFEE'
                            <%}%> >
                                <td width ="3%" align="center" class='NArialL' ><nested:checkbox property="checked" disabled="true"/></td>
                                <td width="10%" class="NArialL" nowrap>
                                    <nested:write property="lotNumber" />
                                    <nested:hidden property="checked"/>
                                </td>
                                <td width="10%" align='right' class="NArialL">
                                    <nested:write property="availableQty" />
                                </td>
                                <td width="10%" align='right' class="NArialL">
                                    <nested:text property ="pulledQty" styleClass="valuetxfield" disabled="true" maxlength="7" />
                                    <nested:hidden property="pulledQty"/>
                                </td>
                              <% totalPulledQty += shippingRequestLot.getPulledQty();%>
                          </tr>
                        </nested:iterate>
                        <TR>
                            <TD>&nbsp;</TD>
                            <TD colspan="2" align="right" class="NArialL">Running Total:</TD>
                            <TD><input type="text" name="runningTotal" class="valuetxfield" disabled="true" value="<%=totalPulledQty%>"></TD>
                        </TR>
                    </table>
                </TD>
           </TR>

            <tr>
            <td class="NArialL" width="15%">
                Special Instructions:
			</td>
            <td class="NArialL" width="25%" >
			    <nested:textarea  property="specialInstr" styleClass="txfield" cols="30" rows="5" disabled="true"/>
			</td>
            <td class="NArialL"colspan="2" width="20%">&nbsp;</td>
			</tr>
             <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
             <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
            <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
		</TABLE>
    </nested:nest>
	</html:form>
<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</BODY>
<%
    }
    catch(Exception e )
    {
        e.printStackTrace();
    }
%>
</HTML>